export interface IBaseInstance<T = any> {
    new(): SuperBaseInstance
    readonly inst: T
}

class SuperBaseInstance {
    private static _base_inst = null;
    public static get inst() {
        if (this._base_inst === null) {
            this._base_inst = new this() as any;
        }
        return this._base_inst;
    }
}

export default function BaseInstance<T = any>() {
    return SuperBaseInstance as any as IBaseInstance<T>;
}